package com.citsin.atlas.viewmodel

import android.content.Context
import androidx.paging.DataSource
import com.citsin.atlas.bean.Media

/**
 * citsin
 * 2019-06-03
 */
class MediaDataSourceFactory(
    private val context: Context, private val mediaTypes: Array<Int>,
    private val bucketId: String
) :
    DataSource.Factory<Int, Media>() {

    override fun create(): DataSource<Int, Media> {
        return MediaDataSource(context.contentResolver, mediaTypes, bucketId)
    }
}